package com.bdqn.qnnews.search.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

/**
 * 用于封装es索引库索引的实体类
 * @author xlzhang
 */
@Data
// 索引库名称
@Document(indexName = "app_info_article")
public class AppInfoArticle {
    @Id
    private Long id;

    @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second)
    private LocalDateTime publishTime;

    @Field(type = FieldType.Integer)
    private Integer layout;

    @Field(type = FieldType.Keyword)
    private String images;

    @Field(type = FieldType.Keyword)
    private String staticUrl;

    @Field(type = FieldType.Long)
    private Long authorId;

    @Field(type = FieldType.Keyword)
    private String authorName;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String title;
}